package com.cy.detectsys.controller.attacksurface;

import com.cy.detectsys.config.CustomException;
import com.cy.detectsys.entity.TcPackage;
import com.cy.detectsys.model.PageReqModel;
import com.cy.detectsys.service.TcPackageService;
import com.cy.detectsys.util.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 【目标资产探测】页面的查询接口
 */
@RestController
@RequestMapping("attack/package")
public class TaskQueryController {

    @Resource
    private TcPackageService tcPackageService;

    @RequestMapping("list")
    public R list(@RequestBody PageReqModel pageReqModel) {
        if (pageReqModel.getPage() == null || pageReqModel.getPageSize() == null) {
            throw new CustomException("分页查询异常");
        }
        return tcPackageService.list(pageReqModel);

    }


}
